#pragma once
#include "myhash.h"
template<class k, class hash = hashfunc<k>>
class unordered_set
{
public:
	typedef hashnode<k> node;
	struct setkeyoft
	{
		k operator()(const k& kv)
		{
			return kv;
		}
	};
	typedef typename hashtable<k, k, hash, setkeyoft>::Iterator iterator;
	typedef typename hashtable<const k, const k, hash, setkeyoft>::const_Iterator const_iterator;
	node* find(const k& key)
	{
		return _ht.find(key);
	}
	bool insert(const k& kv)
	{
		return _ht.insert(kv).second;
	}
	bool erase(const k& key)
	{
		return _ht.erase(key);
	}
	iterator begin()
	{
		return _ht.begin();
	}
	iterator end()
	{
		return _ht.end();
	}
	const_iterator begin() const
	{
		return _ht.begin();
	}
	const_iterator end() const
	{
		return _ht.end();
	}
private:
	hashtable<k, k, hash, setkeyoft> _ht;
};